<script setup>
import { reactive, ref } from 'vue'

// 登录页绑定数据对象
const loginModel = reactive({
  username: '',
  password: '',
})

// 登录页表单验证规则
const loginRules = {
  username: [
    { required: true, message: '请输入姓名', trigger: 'blur' },
    { min: 2, max: 10, message: '长度2到10个字符', trigger: 'blur' },
  ],
  password: [
    { required: true, message: '请输入密码', trigger: 'blur' },
    { min: 2, max: 10, message: '长度2到10个字符', trigger: 'blur' },
  ],
}

const loginRef = ref()
</script>

<template>
  <el-form
    label-width="70px"
    label-position="left"
    class="form-content"
    :model="loginModel"
    :rules="loginRules"
    ref="loginRef"
  >
    <el-form-item label-width="0px">
      <h2>登录</h2>
    </el-form-item>

    <el-form-item label="用户名" prop="username">
      <el-input v-model="loginModel.username"></el-input>
    </el-form-item>

    <el-form-item label="密码" prop="password">
      <el-input v-model="loginModel.password"></el-input>
    </el-form-item>

    <el-form-item label-width="0px">
      <button>点击登录</button>
    </el-form-item>

    <el-form-item label-width="0px" class="bottom-check">
      <!-- <div @click="showLogin=false"> -->
      <img src="@/assets/icon_right_black.png" alt="" />
      <span>注册</span>
      <!-- </div> -->
    </el-form-item>
  </el-form>
</template>
